package com.zhg.demo.mybatis.controller;


import com.zhg.demo.mybatis.entity.UserA;
import com.zhg.demo.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/findAll")
    public List<UserA> findAll(){
        System.out.println(1);
        List<UserA> user = userService.findAll();
        userService.update(new UserA());
        return user;
    }

}
